package com.example.demo.controller;

import com.example.demo.entity.ProductCategory;
import com.example.demo.entity.User;
import com.example.demo.service.ProductCategoryService;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Administrator on 2018/6/9 0009.
 */
@Controller
@RequestMapping("productCategory")
public class ProductCategoryController {

    @Autowired
    private UserService userService;

    @Autowired
    private ProductCategoryService productCategoryService;

    @RequestMapping("/findUser")
    @ResponseBody
    public User findUser() {
        return userService.findByName("zsh");
    }




    @RequestMapping("/findProductCategory")
    @ResponseBody
    public ProductCategory findProductCategory() {


        return productCategoryService.findByName("好吃的");
    }
}



